<template>
	<view class="shipping">
		<view class="info" v-if="list.length > 0">
			<view class="uni-timeline" style="padding: 30upx 20upx;background-color: #fff;">
				<view class="uni-timeline-item " :class="index==0?'uni-timeline-first-item':''" v-for="(item, index) in list" :key="index">
					<view class="uni-timeline-item-divider"></view>
					<view class="uni-timeline-item-content">
						<view>{{item.AcceptStation}}</view>
						<view class="datetime">{{item.AcceptTime}}</view>
					</view>
				</view>
			</view>
		</view>
		<view class="no-data" v-else>{{tips}}</view>
	</view>
</template>

<script>
	import Request from '../../common/request.js';
	
	export default {
		data() {
			return {
				code : "",
				name : "",
				no : "",
				list: [],
				tips:'暂没物流信息',
			};
		},
		onLoad(e) {
			this.code = e.code;
			this.name = e.name;
			this.no = e.no;
			this.getShipping();
		},
		methods: {
			getShipping: function(){
				
				var that = this;
				var url =  'shipping/info';
				Request.send({
					url: url,
					data: {
						code: that.code,
						no: that.no
					},
					sCallback: function(res) {
						that.list = res.data.traces;
						that.tips = res.data.tips;
					}
				})
			}
		}
	}
</script>

<style>
	.uni-timeline-item .uni-timeline-item-divider{
		background-color: #e60012;
	}
</style>
